package com.gjj.abox.utils;

import android.content.Context;
import android.net.Uri;

import com.facebook.drawee.view.SimpleDraweeView;
import com.gjj.abox.database.R;

import java.io.IOException;

/**
 * Created by DWCloud on 2016/4/12.
 */
public class FrescoUtil {
    //加载网络图片
    public static void loadNetUrl(SimpleDraweeView sdv,String url){
        sdv.setImageURI(Uri.parse(url));
    }
    //加载本地图片
    public static void loadFileUrl(SimpleDraweeView sdv,String path){
        sdv.setImageURI(Uri.parse("file://"+path));
    }

    //加载Content provider
    public static void loadContentProvider(SimpleDraweeView sdv,String path){
        sdv.setImageURI(Uri.parse("content://"+path));
    }

    //加载asset
    public static void loadAsset(SimpleDraweeView sdv,String name) {
        sdv.setImageURI(Uri.parse("asset://com.gjj.abox/"+name));
    }

    //加载res
    public static void loadRes(SimpleDraweeView sdv,int idName){
        sdv.setImageURI(Uri.parse("res://com.gjj.abox/"+ idName));
    }
}
